<script setup>
import { downloadApp } from "@/api/base";
import { ref } from "vue";

const app = ref([]);
const getApp = async () => {
  try {
    const res = await downloadApp();
    app.value = res.data;
  } catch (err) {
    console.log(err);
  }
};
getApp();
</script>

<template>
  <div class="apps">
    <p class="app-title">立即下载</p>
    <p class="title-tips">在所有设备上给你出色的设计体验</p>
    <div class="list">
      <div class="item" v-for="item in app" :key="item.id">
        <img class="app-icon" :src="item.icon" alt="" />
        <p class="name">{{ item.label }}</p>
        <span class="type">{{ item.subLabel }}</span>
        <p class="line"></p>
        <p class="tips" v-html="item.introduce"></p>
        <div class="qr">
          <img :src="item.qrCode" alt="" />
        </div>
        <span class="pla">{{ item.platform }}</span>
      </div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.apps {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0 60px;
  background: rgba(249, 249, 249, 1);
}
.app-title {
  font-weight: 600;
  font-size: 28px;
  color: #191e28;
  margin-bottom: 8px;
}
.title-tips {
  color: rgba(25, 30, 40, 0.48);
  font-size: 18px;
  margin-bottom: 48px;
}
.list {
  display: flex;
  .item {
    box-shadow: 0px 0px 20px 0px rgba(25, 30, 40, 0.06);
    border-radius: 24px 24px 24px 24px;
    border: 1px solid rgba(25, 30, 40, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px;
    background: #fff;
    margin-right: 48px;
    &:last-child {
      margin-right: 0;
    }
    .app-icon {
      width: 68px;
      height: 68px;
      margin-bottom: 20px;
    }
    .name {
      font-size: 20px;
      color: #191e28;
      font-weight: bold;
      margin-bottom: 4px;
    }
    .type {
      background: rgba(29, 191, 115, 0.08);
      border-radius: 4px 4px 4px 4px;
      color: #1dbf73;
      font-size: 12px;
      padding: 2px 8px;
      margin-bottom: 18px;
    }
    .line {
      width: 100%;
      height: 1px;
      background: linear-gradient(
        90deg,
        rgba(25, 30, 40, 0) 0%,
        rgba(25, 30, 40, 0.24) 50%,
        rgba(25, 30, 40, 0) 100%
      );
      margin-bottom: 12px;
    }
    .tips {
      color: rgba(25, 30, 40, 0.6);
      font-size: 12px;
      line-height: 20px;
    }
    .qr {
      margin-top: 20px;
      border-radius: 8px;
      border: 1px solid rgba(25, 30, 40, 0.08);
      width: 100px;
      height: 100px;
      margin-bottom: 15px;
      img {
        width: 100%;
        height: 100%;
      }
    }
    .pla {
      color: #191e28;
      font-size: 12px;
    }
  }
}
</style>